| 
                
               | 
              
                
               | 
              
                @@ -28,7 +28,10 @@ def upload_antigen(request): 
               | 
            
            
            
              | 
                28
               | 
              
                28
               | 
              
                     detect_at = tc.string_to_datetime(detect_at, format='%Y-%m-%d %H:%M:%S') 
               | 
            
            
            
              | 
                29
               | 
              
                29
               | 
              
                  
               | 
            
            
            
              | 
                30
               | 
              
                30
               | 
              
                     try: 
               | 
            
            
            
              | 
                31
               | 
              
                
               | 
              
                -        user = IsolationPointUserInfo.objects.get(Q(fields__icontains=phone, member_id='') | Q(unionid=unionid), status=True) 
               | 
            
            
            
              | 
                
               | 
              
                31
               | 
              
                +        if unionid: 
               | 
            
            
            
              | 
                
               | 
              
                32
               | 
              
                +            user = IsolationPointUserInfo.objects.get(unionid=unionid, status=True) 
               | 
            
            
            
              | 
                
               | 
              
                33
               | 
              
                +        else: 
               | 
            
            
            
              | 
                
               | 
              
                34
               | 
              
                +            user = IsolationPointUserInfo.objects.get(fields__icontains=phone, member_id='', status=True) 
               | 
            
            
            
              | 
                32
               | 
              
                35
               | 
              
                         user.detect_at = detect_at 
               | 
            
            
            
              | 
                33
               | 
              
                36
               | 
              
                         user.antigen_result = result 
               | 
            
            
            
              | 
                34
               | 
              
                37
               | 
              
                         user.antigen_observed_ymds = list(set(user.antigen_observed_ymds + [tc.local_string(format='%Y-%m-%d')])) 
               |